package com.hhs.storage.controller;


import com.hhs.storage.bean.PersonConfig;
import com.hhs.storage.service.PersonConfigService;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hhs
 * @since 2023-04-21
 */
@RestController
@RequestMapping("/personConfig")
public class PersonConfigController {
    @Resource
    private PersonConfigService personConfigService;

    /**
     * 个人计划未执行通知设置
     * @param userId
     * @return
     */
    @RequestMapping("/getPersonPlanUndoNotifyConfig")
    public Map getPersonPlanUndoNotifyConfig(String userId){
        return personConfigService.getPersonPlanUndoNotifyConfig(userId);
    }

    /**
     * 更新-个人计划未执行通知设置
     * @param userId
     * @param open
     * @param time
     * @return
     */
    @RequestMapping("/editPersonPlanUndoNotifyConfig")
    public Map editPersonPlanUndoNotifyConfig(String userId,Boolean open,Integer time){
        return personConfigService.editPersonPlanUndoNotifyConfig(userId,open,time);
    }
    /**
     * 添加-统计忽略人员设置
     * @return
     */
    @RequestMapping("/getPlanStatisticalIgnoreUserConfig")
    public Map getPlanStatisticalIgnoreUserConfig(){
        return personConfigService.getPlanStatisticalIgnoreUserConfig();
    }

    /**
     * 更新-统计忽略人员设置
     * @param userIds 忽略的人员id
     * @return
     */
    @RequestMapping("/editPlanStatisticalIgnoreUserConfig")
    public Map editPlanStatisticalIgnoreUserConfig(String userIds){
        return personConfigService.editPlanStatisticalIgnoreUserConfig(userIds);
    }

    @RequestMapping("/editSysLayout")
    public Map editSysLayout(String configStr){
        return personConfigService.editSysLayout( configStr);
    }

}

